
package com.gouaixin.bee.beeframework2.bean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;


public class GOODS
{


//    // 商品
//    "GOODS" :
//    {
//        "! goods_id"              :  32,	 // 商品ID
//            "name"                    :  "标题",	 // 商品名称
//            "brief"                   : "简要",	 // 商品描述
//            "img"                     : "{PHOTO}"	 // 商品图片
//    },

    public String goods_id;//商品ID
    public String name;//商品名称
    public String brief;//商品描述
    public String img;//商品图片


    public void  fromJson(JSONObject jsonObject)  throws JSONException
    {
        if(null == jsonObject){
            return ;
        }
        JSONArray subItemArray;

        this.goods_id = jsonObject.optString("goods_id");
        this.name = jsonObject.optString("name");
        this.brief = jsonObject.optString("brief");
        this.img = jsonObject.optString("img");

        return ;
    }

    public JSONObject toJson() throws JSONException
    {
        JSONObject localItemObject = new JSONObject();
        JSONArray itemJSONArray = new JSONArray();

        localItemObject.put("goods_id", goods_id);
        localItemObject.put("name", name);
        localItemObject.put("brief", brief);
        localItemObject.put("img", img);

        return localItemObject;
    }


}
